14. Environment Setup (Linux)

Linux

Steps

  • Ensure all dependencies are present per Project Resources earlier in the lesson
  • Clone the project repository
  • Follow these the instructions in the uWebSocketIO starter guide earlier in the lesson (From the project repository directory run the script: install-ubuntu.sh .
  • on the command line execute ./install-ubuntu.sh
  • build and run according to the instructions in the project repository README

Trouble Shooting

These steps are similar to those with Ubuntu BASH on Windows 10, above.

  • .sh files not recognized on run: Try chmod a+x <filename.sh> for example chmod a+x install-ubuntu.sh
  • Messages regarding 404s, missing resources, and a variety of other error messages can be addressed by updates and other means, per this Knowledge post . The general steps are:

** Not all steps will be necessary, for example, installing git and cloning the project repository, if this has already been done.**

  1. sudo apt-get update
  2. sudo apt-get install git
  3. sudo apt-get install cmake
  4. sudo apt-get install openssl
  5. sudo apt-get install libssl-dev
  6. git clone https://github.com/udacity/CarND-Kidnapped-Vehicle-Project or whatever CarND project
  7. sudo rm /usr/lib/libuWS.so
  8. navigate to CarND-Kidnapped-Vehicle-Project/
  9. ./install-ubuntu.sh
  10. at the top level of the project repository mkdir build && cd build
  11. from /build cmake .. && make
  12. Launch the simulator from Windows and execute the run command for the project, for example ./ExtendedKF or ./particle_filter (Make sure you also run the simulator)
    If you see this message, it is working Listening to port 4567 Connected!!!

After following these steps there may be some messages regarding makefile not found or can't create symbolic link to websockets. There is likely nothing wrong with the installation. Before doing any other troubleshooting make sure that steps 10 and 11 have been executed from the top level of the project directory, then test the installation using step 12.

Step 9 may fail for number of reasons as listed below:

  • install-ubuntu.sh has only rw but no x permission. Run chmod a+x install-ubuntu.sh to give execution permission
  • Cannot find the package libuv1-dev
    • To install the package run sudo apt-get install libuv1.dev
    • If you still cannot install the package run the following to get the package and install it:
      • sudo add-apt-repository ppa:acooks/libwebsockets6
      • sudo apt-get update
      • sudo apt-get install libuv1.dev
  • May complain about the version of cmake you have. You need a version greater than 3.0. Here is a link which describes how to get version 3.8. Look at Teocci's response in this link
  • Installing cmake requires g++ compiler. Install a g++ version 4.9 or greater. Here are the steps:
    • sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    • sudo apt-get update
    • sudo apt-get install g++-4.9

** A Note Regarding Step 11**
This step can fail if the bash shell is still referring to an older g++ version. To address this, please refer to this Ask Ubuntu post .